package cc.vv.btpartyjob.jobactivities.server

import cc.vv.baselibrary.http.BaseHttpRequest
import cc.vv.btpartyjob.jobactivities.api.JobActivitiesAPI
import cc.vv.btpartyjob.jobactivities.moudel.bean.JobBean
import cc.vv.btpartyjob.jobactivities.moudel.reps.HeXinJiaZhiRequestObj
import cc.vv.btpartyjob.jobactivities.moudel.reps.MingZhuLifeParamObj
import cc.vv.btpartyjob.jobactivities.moudel.reps.SanHuiYiKeRequestObj
import cc.vv.btpartyjob.jobactivities.moudel.reps.ZhiBuActivitiesRequestObj
import cc.vv.btpartyjob.jobactivities.moudel.req.HeXinJiaZhiResponseObj
import cc.vv.btpartyjob.jobactivities.moudel.req.MingZhuLifeResponseObj
import cc.vv.btpartyjob.jobactivities.moudel.req.SanHuiYiKeResponseObj
import cc.vv.btpartyjob.jobactivities.moudel.req.ZhiBuActivitiesResponseObj
import cc.vv.lkbasecomponent.http.lib.setting.Settings
import cc.vv.lklibrary.http.base.okhttpfactory.plugins.httpplugin.MediaTypeWrap

/**
 * 党务管理Server
 * Created by Chen.qi on 2018/10/24.
 */
object JobActivitiesServer {

    fun getUnitHouse(): ArrayList<JobBean> {
        val optionList = ArrayList<JobBean>()
        val obj = JobBean("", "宝塔头条")
        val obj1 = JobBean("", "街道头条")
        val obj2 = JobBean("", "社区头条")
        val obj3 = JobBean("", "网格头条")
        optionList.add(obj)
        optionList.add(obj1)
        optionList.add(obj2)
        optionList.add(obj3)
        return optionList
    }

    fun getTycipal(): ArrayList<JobBean> {
        val optionList = ArrayList<JobBean>()
        val obj = JobBean("", "农村党组织")
        val obj1 = JobBean("", "机关党组织")
        val obj2 = JobBean("", "社区党组织")
        val obj3 = JobBean("", "学校党组织")
        val obj4 = JobBean("", "非公党组织")
        val obj5 = JobBean("", "社会组织党组织")
        val obj6 = JobBean("", "国家企事业单位党组织")
        optionList.add(obj)
        optionList.add(obj1)
        optionList.add(obj2)
        optionList.add(obj3)
        optionList.add(obj4)
        optionList.add(obj5)
        optionList.add(obj6)
        return optionList
    }

    /**
     * 返回标题
     */
    fun getTypeTitleArrayString(): ArrayList<String> {
        return arrayListOf("农村党组织", "机关党组织", "社区党组织", "学校党组织", "非公党组织", "社会组织党组织", "国家企事业单位党组织")
    }


    /** 获取三会一课列表*/
    fun getSanHuiYiKeList(branchId: String?, branchType: String?, page: Int?, pageSize: Int?, isShow: Boolean = false) {
        val request = SanHuiYiKeRequestObj()
        request.branchType = branchType
        request.branchId = branchId
        request.page = "$page"
        request.pageSize = "$pageSize"
        val path = JobActivitiesAPI.sanhuiyikeList + "/" + "$page" + "/" + "$pageSize" + "?$branchId" + "?$branchType"
        BaseHttpRequest.postRequest(path, request, SanHuiYiKeResponseObj::class.java, isShow)
    }

    /** 获取支部活动列表*/
    fun getZhiBuActivitiesList(branchId: String?, branchType: String?, page: Int?, pageSize: Int?, isShow: Boolean = false) {
        val request = ZhiBuActivitiesRequestObj()
        request.branchId = branchId
        request.branchType = branchType
        request.page = "$page"
        request.pageSize = "$pageSize"
        val path = JobActivitiesAPI.zhiBuActivitiesList + "/" + "$page" + "/" + "$pageSize" + "?$branchId" + "?$branchType"
        BaseHttpRequest.postRequest(path, request, ZhiBuActivitiesResponseObj::class.java, isShow)
    }

    /**
     * 民主生活会
     */
    fun getMingZhuLifeMeetingList(page: Int?, pageSize: Int?, param: MingZhuLifeParamObj?, isShow: Boolean = false) {
        val request = ZhiBuActivitiesRequestObj()
        request.page = "$page"
        request.pageSize = "$pageSize"
        val path = JobActivitiesAPI.mingZhuMeetingList + "/" + "$page" + "/" + "$pageSize"
        BaseHttpRequest.postRequest(path, param, MingZhuLifeResponseObj::class.java, isShow,
                Settings(MediaTypeWrap.MEDIA_TYPE_RAW_JSON))
    }

    /**
     * 组织生活会
     */
    fun getZuZhiLifeMeetingList(page: Int?, pageSize: Int?, param: MingZhuLifeParamObj?, isShow: Boolean = false) {
        val request = ZhiBuActivitiesRequestObj()
        request.page = "$page"
        request.pageSize = "$pageSize"
        val path = JobActivitiesAPI.zuZhiLifeMeetingList + "/" + "$page" + "/" + "$pageSize"
        BaseHttpRequest.postRequest(path, param, MingZhuLifeResponseObj::class.java, isShow,
                Settings(MediaTypeWrap.MEDIA_TYPE_RAW_JSON))
    }

    /**
     * 社会主义核心价值观
     */
    fun getSheHuiZhuYiJiaZhiGuanList(page: Int?, pageSize: Int?, type: String?, isShow: Boolean = false) {
        val request = HeXinJiaZhiRequestObj()
        request.page = "$page"
        request.pageSize = "$pageSize"
        request.type = "$type"
        val path = JobActivitiesAPI.HeXinJiaZhiListUrl + "/$page" + "/$pageSize"
        BaseHttpRequest.postRequest(path, request, HeXinJiaZhiResponseObj::class.java, isShow)

    }

}